package com.tekj.cxqcb.operation;

import android.content.Context;

import com.lzy.okgo.model.HttpParams;
import com.tekj.cxqcb.config.Urls;
import com.tekj.cxqcb.operation.resultBean.ApiShopServiceSelectAllBean;
import com.tekj.cxqcb.operation.resultBean.ApiShopServiceTypeBean;
import com.tekj.cxqcb.operation.resultBean.AppLoginBean;
import com.tekj.cxqcb.operation.resultBean.AreaListBean;
import com.tekj.cxqcb.operation.resultBean.CarStoresBean;
import com.tekj.cxqcb.operation.resultBean.DoGetCaristForBrandBean;
import com.tekj.cxqcb.operation.resultBean.DoGetFinancialPlanByCarIdBean;
import com.tekj.cxqcb.operation.resultBean.DoGetOrderByIdBean;
import com.tekj.cxqcb.operation.resultBean.GetCarBrandAndModelBean;
import com.tekj.cxqcb.operation.resultBean.GetCarListBean;
import com.tekj.cxqcb.operation.resultBean.MemberUpgradePayBean;
import com.tekj.cxqcb.operation.resultBean.OrderListBean;
import com.tekj.cxqcb.operation.resultBean.PubStatusBean;
import com.tekj.cxqcb.operation.resultBean.QueryCarDealerDetailsPrivateBean;
import com.tekj.cxqcb.operation.resultBean.QueryHotWordBean;
import com.tekj.cxqcb.operation.resultBean.SelectAllForBusinessBean;
import com.tekj.cxqcb.operation.resultBean.SelectByIdBean;
import com.tekj.cxqcb.operation.resultBean.SelectByLevelBean;
import com.tekj.cxqcb.operation.resultBean.SelectCarByColorBean;
import com.tekj.cxqcb.operation.resultBean.SelectDetailBean;
import com.tekj.cxqcb.operation.resultBean.SelectExpandDetailBean;
import com.tekj.cxqcb.operation.resultBean.SelectExpandListBean;
import com.tekj.cxqcb.operation.resultBean.SelectExpandOrderListBean;
import com.tekj.cxqcb.operation.resultBean.SelectInviteListBean;
import com.tekj.cxqcb.operation.resultBean.SelectMsgOfInviteBean;
import com.tekj.cxqcb.operation.resultBean.SelectPresentationBean;
import com.tekj.cxqcb.operation.resultBean.SelectPublicTakeCarShopByUserIdBean;
import com.tekj.cxqcb.operation.resultBean.SelectUserBankListBean;
import com.tekj.cxqcb.operation.resultBean.ShopGoodsListBean;
import com.tekj.cxqcb.operation.resultBean.ShopServiceOrder;
import com.tekj.cxqcb.operation.resultBean.UploadFileBean;
import com.tekj.cxqcb.operation.resultBean.UploadFiles;
import com.tekj.cxqcb.operation.resultBean.VersionBean;
import com.tekj.cxqcb.operation.resultBean.selectAllBrandBean;
import com.tekj.cxqcb.view.Module.bean.ApiShopServiceInsertBean;
import com.tekj.cxqcb.view.Module.bean.NewOrderBean;
import com.tekj.cxqcb.view.Module.bean.UpCarShopAddressBean;
import com.tekj.cxqcb.view.Module.bean.UpShopInsertBean;
import com.tekj.cxqcb.view.Module.bean.UpdateContractBean;
import com.tekj.cxqcb.view.Module.bean.UpdateRequestContractBean;

import java.io.File;
import java.util.List;

import common.base.interfaces.ViewInterface;
import common.base.operationHelper.Bean.BindingViewBean;
import common.base.operationHelper.Interface.OkGoHttpListener;
import common.base.operationHelper.OkGoHttp;
import common.tool.JsonTool;

/**
 * 商户端所有接口请求方法
 */
public class BusinessDao {
    private Context mContext;
    private OkGoHttp mOkGoHttp;
    private ViewInterface mViewInterface;

    public BusinessDao(Context mContext, ViewInterface mViewInterface) {
        this.mContext = mContext;
        this.mViewInterface = mViewInterface;
        mOkGoHttp = new OkGoHttp(mContext);
    }

    /**
     * @param phone
     */
    public void SendCode(String phone) {
        HttpParams mParams = new HttpParams();
        mParams.put("phone", phone);
        mParams.put("type", 3);
        mOkGoHttp.Url(Urls.SendCode)
                .HttpParams(mParams)
                .Post(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        PubStatusBean mJsonBean = JsonTool.parseObject(mString, PubStatusBean.class);
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.短信验证码);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });

    }

    /**
     * 登陆
     *
     * @param phone
     * @param code
     */
    public void AppLogin(String phone, String code) {
        HttpParams mParams = new HttpParams();
        mParams.put("phone", phone);
        mParams.put("code", code);
        mParams.put("userType", 1);
        mOkGoHttp.Url(Urls.AppLogin)
                .HttpParams(mParams)
                .Post(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        AppLoginBean mJsonBean = JsonTool.parseObject(mString, AppLoginBean.class);
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.登陆);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });

    }

    /**
     * 刷新登陆信息
     *
     * @param userId
     */
    public void selectUserById(String userId) {
        HttpParams mParams = new HttpParams();
        mParams.put("userId", userId);
        mParams.put("userType", 1);
        mOkGoHttp.Url(Urls.selectUserById)
                .HttpParams(mParams)
                .Get(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        AppLoginBean mJsonBean = JsonTool.parseObject(mString, AppLoginBean.class);
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.登陆2);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });

    }

    /**
     * 获取 省/市/区
     *
     * @param parentId
     */
    public void selectAllAddress(String parentId) {
        HttpParams mParams = new HttpParams();
        mParams.put("parentId", parentId);
        mOkGoHttp.Url(Urls.selectAllAddress)
                .HttpParams(mParams)
                .Get(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        AreaListBean mJsonBean = JsonTool.parseObject(mString, AreaListBean.class);
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.省市区列表);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });
    }

    /**
     * 查找所有的型号和品牌
     */
    public void GetCarBrandAndModel() {
        HttpParams mParams = new HttpParams();
        mOkGoHttp.Url(Urls.GetCarBrandAndModel)
                .HttpParams(mParams)
                .Get(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        GetCarBrandAndModelBean mJsonBean = JsonTool.parseObject(mString, GetCarBrandAndModelBean.class);//Gson转Bean
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.获取所有分类);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });

    }

    /**
     * @param orderBy  排序
     * @param offset   页码
     * @param name     搜索条件
     * @param brandIds 品牌
     * @param modelIds 车型
     * @param //city
     */
    public void GetCarList(String orderBy, int offset, String name,
                           String brandIds, String modelIds/*, String city*/
            , String desc) {
        HttpParams mParams = new HttpParams();
        mParams.put("orderBy", orderBy);
        mParams.put("offset", offset);
        mParams.put("name", name);
        mParams.put("brandIds", brandIds);
        mParams.put("modelIds", modelIds);
        mParams.put("sortingRules", desc);

        mParams.put("limit", 10);
//        mParams.put("city", city);

        mOkGoHttp.Url(Urls.GetCarList)
                .HttpParams(mParams)
                .Get(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        GetCarListBean mJsonBean = JsonTool.parseObject(mString, GetCarListBean.class);//Gson转Bean
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.筛选后的车型);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });

    }

    /**
     * 新增店铺
     *
     * @param insertBean
     */
    public void ApiShopInsert(UpShopInsertBean insertBean) {

        HttpParams mParams = new HttpParams();
        mParams.put("shopName", insertBean.getShopName());
        mParams.put("province", insertBean.getProvince());
        mParams.put("city", insertBean.getCity());
        mParams.put("region", insertBean.getRegion());
        mParams.put("address", insertBean.getAddress());
        mParams.put("shopImage", insertBean.getShopImage());
        mParams.put("businessId", insertBean.getBusinessId());
        mParams.put("businessLicense", insertBean.getBusinessLicense());
        mParams.put("idcardOne", insertBean.getIdcardOne());
        mParams.put("idcardTwo", insertBean.getIdcardTwo());
        mParams.put("authorization", insertBean.getAuthorization());
        mParams.put("remark", insertBean.getRemark());
        mParams.put("shopTel", insertBean.getShopTel());
        mParams.put("longitude", insertBean.getLongitude());
        mParams.put("latitude", insertBean.getLatitude());
        mOkGoHttp.Url(Urls.ApiShopInsert)
                .HttpParams(mParams)
                .Post(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        PubStatusBean mJsonBean = JsonTool.parseObject(mString, PubStatusBean.class);//Gson转Bean
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.添加申请店铺);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });

    }

    /**
     * 查询店铺服务分类接口
     */
    public void selectByLevel(final int level, String parent_id) {
        if (level == 1) {
            mViewInterface.initLoadStart();
        }
        HttpParams mParams = new HttpParams();
        mParams.put("level", level);
        mParams.put("parentId", parent_id);
        mOkGoHttp.Url(Urls.selectByLevel)
                .HttpParams(mParams)
                .Post(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        SelectByLevelBean mJsonBean = JsonTool.parseObject(mString, SelectByLevelBean.class);//Gson转Bean
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(level == 1 ?
                                BindingViewBean.EnumStatus.店铺服务分类 : BindingViewBean.EnumStatus.店铺服务分类2);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });

    }

    /**
     * 多文件上传
     *
     * @param uploadFiles
     */
    public void uploadFiles(List<File> uploadFiles, final String typeName) {

        mViewInterface.initLoadStart();

        HttpParams mParams = new HttpParams();
        mParams.putFileParams("uploadFiles", uploadFiles);
        mOkGoHttp.Url(Urls.uploadFiles)
                .HttpParams(mParams)
                .Post(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        UploadFiles mJsonBean = JsonTool.parseObject(mString, UploadFiles.class);//Gson转Bean
                        mJsonBean.setTypeName(typeName);
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.多文件上传);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });
    }


    /**
     * 通过id查找店铺
     */
    public void selectById(String id) {
        HttpParams mParams = new HttpParams();
        mParams.put("id", id);
        mOkGoHttp.Url(Urls.selectById)
                .HttpParams(mParams)
                .Post(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        SelectByIdBean mJsonBean = JsonTool.parseObject(mString, SelectByIdBean.class);//Gson转Bean
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.通过id查找店铺);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });

    }

    /**
     * 通过id查找店铺
     */
    public void selectAll(String id) {
        HttpParams mParams = new HttpParams();
        mParams.put("userId", id);
        mOkGoHttp.Url(Urls.selectAll)
                .HttpParams(mParams)
                .Post(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        SelectByIdBean mJsonBean = JsonTool.parseObject(mString, SelectByIdBean.class);//Gson转Bean
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.通过id查找店铺);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });

    }

    /**
     * 新增店铺商品
     *
     * @param insertBean
     */
    public void ApiShopServiceInsert(ApiShopServiceInsertBean insertBean) {
        mViewInterface.initLoadStart();
        HttpParams mParams = new HttpParams();
        mParams.put("serviceName", insertBean.getServiceName());
        mParams.put("levelOne", insertBean.getLevelOne());
        mParams.put("levelTwo", insertBean.getLevelTwo());
        mParams.put("settlementType", insertBean.getSettlementType());
        mParams.put("marketPrice", insertBean.getMarketPrice());
        mParams.put("price", insertBean.getPrice());
        mParams.put("carType", insertBean.getCarType());
        mParams.put("serviceExplain", insertBean.getServiceExplain());
        mParams.put("serviceImg", insertBean.getServiceImg());
        mParams.put("shopId", insertBean.getShopId());

        mParams.put("inventory", insertBean.getInventory());
        mParams.put("serviceImg2", insertBean.getServiceImg2());
        mParams.put("serviceImg3", insertBean.getServiceImg3());
//        mParams.put("salesVolume", insertBean.getSalesVolume());

        mOkGoHttp.Url(Urls.ApiShopServiceInsert)
                .HttpParams(mParams)
                .Post(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        PubStatusBean mJsonBean = JsonTool.parseObject(mString, PubStatusBean.class);//Gson转Bean
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.新增店铺商品);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });

    }


    /**
     * 修改店铺商品信息
     *
     * @param insertBean
     */
    public void ApiShopServiceUpdate(ApiShopServiceInsertBean insertBean) {
        mViewInterface.initLoadStart();
        HttpParams mParams = new HttpParams();
        mParams.put("id", insertBean.getId());
        mParams.put("serviceName", insertBean.getServiceName());
        mParams.put("levelOne", insertBean.getLevelOne());
        mParams.put("levelTwo", insertBean.getLevelTwo());
        mParams.put("settlementType", insertBean.getSettlementType());
        mParams.put("marketPrice", insertBean.getMarketPrice());
        mParams.put("price", insertBean.getPrice());
        mParams.put("carType", insertBean.getCarType());
        mParams.put("serviceExplain", insertBean.getServiceExplain());
        mParams.put("serviceImg", insertBean.getServiceImg());
        mParams.put("shopId", insertBean.getShopId());
        mParams.put("serviceState", insertBean.getServiceState());

        mParams.put("inventory", insertBean.getInventory());
        mParams.put("serviceImg2", insertBean.getServiceImg2());
        mParams.put("serviceImg3", insertBean.getServiceImg3());
//        mParams.put("salesVolume", insertBean.getSalesVolume());

        mOkGoHttp.Url(Urls.ApiShopServiceUpdate)
                .HttpParams(mParams)
                .Post(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        PubStatusBean mJsonBean = JsonTool.parseObject(mString, PubStatusBean.class);//Gson转Bean
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.修改店铺商品信息);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });

    }

    /**
     * 商品的上下架及删除
     *
     * @param id
     * @param serviceState
     */
    public void ApiShopServiceUpdate(String id, int serviceState) {
        mViewInterface.initLoadStart();
        HttpParams mParams = new HttpParams();
        mParams.put("id", id);
        mParams.put("serviceState", serviceState);

        mOkGoHttp.Url(Urls.ApiShopServiceUpdate)
                .HttpParams(mParams)
                .Post(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        PubStatusBean mJsonBean = JsonTool.parseObject(mString, PubStatusBean.class);//Gson转Bean
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.修改店铺商品信息);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });

    }

    /**
     * 修改店铺资料
     *
     * @param insertBean
     */
    public void ApiShopUpdate(UpShopInsertBean insertBean) {

        HttpParams mParams = new HttpParams();
        mParams.put("id", insertBean.getId());
        mParams.put("shopName", insertBean.getShopName());
//        mParams.put("province", insertBean.getProvince());
        mParams.put("authorization", insertBean.getAuthorization());
        mParams.put("region", insertBean.getRegion());
        mParams.put("address", insertBean.getAddress());
        mParams.put("shopImage", insertBean.getShopImage());
        mParams.put("shopTel", insertBean.getShopTel());
        mParams.put("longitude", insertBean.getLongitude());
        mParams.put("latitude", insertBean.getLatitude());

        mOkGoHttp.Url(Urls.ApiShopUpdate)
                .HttpParams(mParams)
                .Post(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        PubStatusBean mJsonBean = JsonTool.parseObject(mString, PubStatusBean.class);//Gson转Bean
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.添加申请店铺);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });

    }

    /**
     * 修改店铺状态
     *
     * @param id
     * @param shopState
     */
    public void ApiShopupdateShopStateById(String id, int shopState) {
        HttpParams mParams = new HttpParams();
        mParams.put("id", id);
        mParams.put("shopState", shopState);
        mOkGoHttp.Url(Urls.ApiShopupdateShopStateById)
                .HttpParams(mParams)
                .Post(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        PubStatusBean mJsonBean = JsonTool.parseObject(mString, PubStatusBean.class);//Gson转Bean
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.修改店铺状态);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });

    }

    /**
     * 筛选获取商品列表
     *
     * @param id
     * @param levelOne
     * @param levelTwo
     */
    public void ApiShopServiceSelectAll(String id, String levelOne, String levelTwo, int serviceState) {
        HttpParams mParams = new HttpParams();
        mParams.put("shopId", id);
        mParams.put("levelOne", levelOne);
        mParams.put("levelTwo", levelTwo);
        mParams.put("serviceState", serviceState);
        mOkGoHttp.Url(Urls.ApiShopServiceSelectAll)
                .HttpParams(mParams)
                .Post(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {
                        ApiShopServiceSelectAllBean mJsonBean = JsonTool.parseObject(mString, ApiShopServiceSelectAllBean.class);//Gson转Bean
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.筛选获取商品列表);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();
                    }

                    @Override
                    public void onError(String mString) {

                    }
                });

    }

    /**
     * 单文件上传
     *
     * @param path
     */
    public void UploadFile(String path) {
        mViewInterface.initLoadStart();
        HttpParams mParams = new HttpParams();
        mParams.put("file", new File(path));
        mOkGoHttp.Url(Urls.UploadFile)
                .HttpParams(mParams)
                .Post(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        UploadFileBean mJsonBean = JsonTool.parseObject(mString, UploadFileBean.class);
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.单文件上传);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });
    }


    /**
     * 意见反馈
     *
     * @param userId
     * @param detail
     */
    public void InsertFeedback(String userId, String detail) {
        mViewInterface.initLoadStart();
        HttpParams mParams = new HttpParams();
        mParams.put("userId", userId);
        mParams.put("detail", detail);
        mOkGoHttp.Url(Urls.InsertFeedback)
                .HttpParams(mParams)
                .Post(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        PubStatusBean mJsonBean = JsonTool.parseObject(mString, PubStatusBean.class);
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.意见反馈);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });
    }

    /**
     * 充值
     *
     * @param id
     * @param type 1支付宝 2微信
     */
    public void BalanceRecharge(String id, final int type, String money) {
        HttpParams mParams = new HttpParams();
        mParams.put("userId", id);
        mParams.put("userType", 1);
        mParams.put("money", money);
        mParams.put("payType", type);
        mOkGoHttp.Url(Urls.BalanceRecharge)
                .HttpParams(mParams)
                .Post(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        MemberUpgradePayBean mJsonBean = JsonTool.parseObject(mString, MemberUpgradePayBean.class);//Gson转Bean
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(type == 1 ?
                                BindingViewBean.EnumStatus.支付宝支付 : BindingViewBean.EnumStatus.微信支付);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });

    }

    /**
     * 修改当前用户信息
     *
     * @param userId
     * @param userType
     * @param head
     * @param nickname
     */
    public void UpdateUserInfo(String userId, String userType, String head, String nickname) {
        mViewInterface.initLoadStart();
        HttpParams mParams = new HttpParams();
        mParams.put("userId", userId);
        mParams.put("userType", userType);
        mParams.put("head", head);
        mParams.put("nickname", nickname);
        mOkGoHttp.Url(Urls.UpdateUserInfo)
                .HttpParams(mParams)
                .Post(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        PubStatusBean mJsonBean = JsonTool.parseObject(mString, PubStatusBean.class);
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.修改用户信息);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });
    }

    /**
     * 修改用户手机号
     *
     * @param userId
     * @param userType
     * @param phone
     * @param newPhone
     * @param code
     */
    public void UpdateUserPhone(String userId, String userType, String phone, String newPhone, String code) {
        mViewInterface.initLoadStart();
        HttpParams mParams = new HttpParams();
        mParams.put("userId", userId);
        mParams.put("userType", userType);
        mParams.put("phone", phone);
        mParams.put("newPhone", newPhone);
        mParams.put("code", code);
        mOkGoHttp.Url(Urls.UpdateUserPhone)
                .HttpParams(mParams)
                .Post(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        PubStatusBean mJsonBean = JsonTool.parseObject(mString, PubStatusBean.class);
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.修改手机号);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });
    }

    /**
     * 查看我的关联渠道
     *
     * @param userId
     * @param offset
     * @param queryType
     */
    public void SelectExpandDetail(String userId, int offset, String queryType, String querySort) {
        mViewInterface.initLoadStart();
        HttpParams mParams = new HttpParams();
        mParams.put("userId", userId);
        mParams.put("limit", 10);
        mParams.put("offset", offset);
        if (queryType != null && !queryType.equals(""))
            mParams.put("queryType", queryType);

        mParams.put("querySort", querySort);

        mOkGoHttp.Url(Urls.SelectExpandDetail)
                .HttpParams(mParams)
                .Get(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        SelectExpandDetailBean mJsonBean = JsonTool.parseObject(mString, SelectExpandDetailBean.class);
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.关联渠道);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });
    }

    /**
     * 获取提车门店
     *
     * @param userId
     */
    public void CarStores(String userId) {
        mViewInterface.initLoadStart();
        HttpParams mParams = new HttpParams();
        mParams.put("userId", userId);
        mOkGoHttp.Url(Urls.CarStores)
                .HttpParams(mParams)
                .Get(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        CarStoresBean mJsonBean = JsonTool.parseObject(mString, CarStoresBean.class);
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.获取提车门店);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });
    }

    /**
     * 修改用户提车门店信息
     *
     * @param bean
     */
    public void UpdateUserTakeCarShop(UpCarShopAddressBean bean) {
        mViewInterface.initLoadStart();
        HttpParams mParams = new HttpParams();
        mParams.put("type", bean.getType());
        mParams.put("oldType", bean.getOldType());
        mParams.put("shopName", bean.getShopName());
        mParams.put("province", bean.getProvince());
        mParams.put("city", bean.getCity());
        mParams.put("region", bean.getRegion());
        mParams.put("address", bean.getAddress());
        mParams.put("longitude", bean.getLongitude());
        mParams.put("latitude", bean.getLatitude());
        mParams.put("shopImage", bean.getShopImage());
        mParams.put("houseNumber", bean.getHouseNumber());
        mParams.put("businessId", bean.getBusinessId());
        mParams.put("publicShopId", bean.getPublicShopId());

        mOkGoHttp.Url(Urls.UpdateUserTakeCarShop)
                .HttpParams(mParams)
                .Post(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        PubStatusBean mJsonBean = JsonTool.parseObject(mString, PubStatusBean.class);
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.修改门店);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });
    }

    /**
     * 通过区域获取公用门店信息
     *
     * @param region
     */
    public void SelectPublicTakeCarShopByUserId(String region, int offset) {
        mViewInterface.initLoadStart();
        HttpParams mParams = new HttpParams();
        mParams.put("region", region);
        mParams.put("limit", 10);
        mParams.put("offset", offset);
        mOkGoHttp.Url(Urls.SelectPublicTakeCarShopByUserId)
                .HttpParams(mParams)
                .Post(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        SelectPublicTakeCarShopByUserIdBean mJsonBean = JsonTool.parseObject(mString, SelectPublicTakeCarShopByUserIdBean.class);
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.公用门店列表);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });
    }

    /**
     * 更新
     */
    public void GetAppVersion() {
        mViewInterface.initLoadStart();
        HttpParams mParams = new HttpParams();
        mParams.put("userType", 1);
        mOkGoHttp.Url(Urls.GetAppVersion)
                .HttpParams(mParams)
                .Get(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        VersionBean mJsonBean = JsonTool.parseObject(mString, VersionBean.class);
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.更新信息);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });
    }

    /**
     * 查看用户拓展记录列表
     */
    public void SelectExpandList(String userId, int state, int offset) {
        mViewInterface.initLoadStart();
        HttpParams mParams = new HttpParams();
        mParams.put("userId", userId);
        if (state != 0)
            mParams.put("state", state);
        mParams.put("limit", 10);
        mParams.put("offset", offset);
        mParams.put("userType", 1);

        mOkGoHttp.Url(Urls.SelectExpandList)
                .HttpParams(mParams)
                .Get(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        SelectExpandListBean mJsonBean = JsonTool.parseObject(mString, SelectExpandListBean.class);
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.拓展记录列表);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });
    }

    /**
     * 根据条件查找会员拉新或者拓展的总人数和奖励数
     *
     * @param userId
     * @param type
     */
    public void SelectMsgOfInvite(String userId, int type) {
        mViewInterface.initLoadStart();
        HttpParams mParams = new HttpParams();
        mParams.put("userId", userId);
        mParams.put("type", type);
        mParams.put("userType", 1);

        mOkGoHttp.Url(Urls.SelectMsgOfInvite)
                .HttpParams(mParams)
                .Get(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        SelectMsgOfInviteBean mJsonBean = JsonTool.parseObject(mString, SelectMsgOfInviteBean.class);
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.拓展拉新人数);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });
    }

    /**
     * 拉新记录
     *
     * @param userId
     * @param offset
     */
    public void SelectInviteList(String userId, int offset) {
        mViewInterface.initLoadStart();
        HttpParams mParams = new HttpParams();
        mParams.put("userId", userId);
        mParams.put("limit", 10);
        mParams.put("offset", offset);
//        mParams.put("userType", 1);

        mOkGoHttp.Url(Urls.SelectInviteList)
                .HttpParams(mParams)
                .Get(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        SelectInviteListBean mJsonBean = JsonTool.parseObject(mString, SelectInviteListBean.class);
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.拉新记录);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });
    }


    /**
     * 查看支付宝账号
     *
     * @param userId
     */
    public void SelectPresentation(String userId) {
        HttpParams mParams = new HttpParams();
        mParams.put("userType", 1);
        mParams.put("userId", userId);
        mOkGoHttp.Url(Urls.SelectPresentation)
                .HttpParams(mParams)
                .Get(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        SelectPresentationBean mJsonBean = JsonTool.parseObject(mString, SelectPresentationBean.class);//Gson转Bean
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.查看支付宝账号);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });

    }

    /**
     * 更新支付宝账号
     *
     * @param userId
     * @param alipayAccount
     * @param alipayName
     */
    public void AddAlipay(String userId, String alipayAccount, String alipayName) {
        HttpParams mParams = new HttpParams();
        mParams.put("userType", 1);
        mParams.put("userId", userId);
        mParams.put("alipayAccount", alipayAccount);
        mParams.put("alipayName", alipayName);

        mOkGoHttp.Url(Urls.AddAlipay)
                .HttpParams(mParams)
                .Post(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        PubStatusBean mJsonBean = JsonTool.parseObject(mString, PubStatusBean.class);//Gson转Bean
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.更新支付宝账号);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });

    }

    /**
     * 提现
     *
     * @param userId
     * @param alipayAccount
     * @param alipayName
     * @param money
     */
    public void Presentation(String userId, String alipayAccount, String alipayName, String money) {

        HttpParams mParams = new HttpParams();
        mParams.put("userType", 1);
        mParams.put("userId", userId);
        mParams.put("alipayAccount", alipayAccount);
        mParams.put("alipayName", alipayName);
        mParams.put("money", money);
        mParams.put("comment", "");

        mOkGoHttp.Url(Urls.Presentation)
                .HttpParams(mParams)
                .Post(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        PubStatusBean mJsonBean = JsonTool.parseObject(mString, PubStatusBean.class);//Gson转Bean
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.提现);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });

    }

    /**
     * 查看我的关联渠道详情
     *
     * @param userId
     */
    public void SelectDetail(String userId) {
        HttpParams mParams = new HttpParams();
        mParams.put("userId", userId);
//        mParams.put("limit", 10);
//        mParams.put("offset", 1);
        mOkGoHttp.Url(Urls.SelectDetail)
                .HttpParams(mParams)
                .Get(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        SelectDetailBean mJsonBean = JsonTool.parseObject(mString, SelectDetailBean.class);//Gson转Bean
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.查看我的关联渠道详情);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });

    }

    /**
     * 关联渠道下查看全部订单
     *
     * @param userId
     * @param orderStatus
     * @param offset
     */
    public void SelectExpandOrderList(String userId, int orderStatus, int offset) {
        mViewInterface.initLoadStart();
        HttpParams mParams = new HttpParams();
        mParams.put("id", userId);
        mParams.put("limit", 10);
        mParams.put("offset", offset);
        if (orderStatus != 1)
            mParams.put("orderStatus", orderStatus);

        mOkGoHttp.Url(Urls.SelectExpandOrderList)
                .HttpParams(mParams)
                .Get(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        SelectExpandOrderListBean mJsonBean = JsonTool.parseObject(mString, SelectExpandOrderListBean.class);
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.关联渠道下查看全部订单);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });
    }

    /**
     * 购车意向列表
     *
     * @param businessId
     * @param isFollow
     */
    public void SelectAllForBusiness(String businessId, int isFollow, int offset) {
        HttpParams mParams = new HttpParams();
        mParams.put("businessId", businessId);
        if (isFollow != 0)
            mParams.put("isFollow", isFollow);
        mParams.put("limit", 10);
        mParams.put("offset", offset);
        mOkGoHttp.Url(Urls.SelectAllForBusiness)
                .HttpParams(mParams)
                .Get(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        SelectAllForBusinessBean mJsonBean = JsonTool.parseObject(mString, SelectAllForBusinessBean.class);//Gson转Bean
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.购车意向列表);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });

    }

    /**
     * 修改购车意向为已读
     *
     * @param businessId
     */
    public void UpdateReadByUser(String businessId) {
        HttpParams mParams = new HttpParams();
        mParams.put("businessId", businessId);
        mOkGoHttp.Url(Urls.UpdateReadByUser)
                .HttpParams(mParams)
                .Post(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        PubStatusBean mJsonBean = JsonTool.parseObject(mString, PubStatusBean.class);//Gson转Bean
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.修改购车意向为已读);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });

    }

    /**
     * @param id       购车意向id
     * @param isFollow 是否关注0否1是
     */
    public void UpdateByFollow(String id, int isFollow) {
        HttpParams mParams = new HttpParams();
        mParams.put("id", id);
        mParams.put("isFollow", isFollow);
        mOkGoHttp.Url(Urls.UpdateByFollow)
                .HttpParams(mParams)
                .Post(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        PubStatusBean mJsonBean = JsonTool.parseObject(mString, PubStatusBean.class);//Gson转Bean
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.修改购车意向为已读);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });

    }


    /**
     * 查看用户银行卡列表
     *
     * @param userId
     */
    public void SelectUserBankList(String userId, int offset) {
        HttpParams mParams = new HttpParams();
        mParams.put("userId", userId);
        mParams.put("limit", 10);
        mParams.put("offset", offset);
        mOkGoHttp.Url(Urls.SelectUserBankList)
                .HttpParams(mParams)
                .Get(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        SelectUserBankListBean mJsonBean = JsonTool.parseObject(mString, SelectUserBankListBean.class);
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.银行卡列表);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });

    }


    /**
     * 银行卡设置默认
     *
     * @param userId
     * @param id
     */
    public void UpdateUserBankDefault(String userId, String id) {
        HttpParams mParams = new HttpParams();
        mParams.put("userId", userId);
        mParams.put("id", id);
        mParams.put("isDefault", 1);
        mOkGoHttp.Url(Urls.UpdateUserBankDefault)
                .HttpParams(mParams)
                .Post(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        PubStatusBean mJsonBean = JsonTool.parseObject(mString, PubStatusBean.class);
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.银行卡默认设置);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });

    }

    /**
     * 删除银行卡
     *
     * @param userId
     * @param id
     */
    public void DeleteUserBank(String userId, String id) {
        HttpParams mParams = new HttpParams();
        mParams.put("userId", userId);
        mParams.put("id", id);
        mOkGoHttp.Url(Urls.DeleteUserBank)
                .HttpParams(mParams)
                .Post(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        PubStatusBean mJsonBean = JsonTool.parseObject(mString, PubStatusBean.class);
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.删除银行卡);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });

    }

    /**
     * 添加银行卡
     *
     * @param userId
     * @param userName
     * @param userIdCard
     * @param cardNumber
     * @param phone
     */
    public void InsertUserBank(String userId, String userName,
                               String userIdCard, String cardNumber,
                               String phone) {
        mViewInterface.initLoadStart();
        HttpParams mParams = new HttpParams();
        mParams.put("userId", userId);
        mParams.put("userName", userName);
        mParams.put("userIdCard", userIdCard);
        mParams.put("cardNumber", cardNumber);
        mParams.put("phone", phone);
        mParams.put("userType", 1);
        mOkGoHttp.Url(Urls.InsertUserBank)
                .HttpParams(mParams)
                .Post(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        PubStatusBean mJsonBean = JsonTool.parseObject(mString, PubStatusBean.class);
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.添加银行卡);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });

    }


    /**
     * @param userId
     * @param payType 1支付宝 2微信3 银行卡 4余额 5支付宝+余额6微信+余额
     */
    public void AllianceBusiness(String userId, final int payType) {
        mViewInterface.initLoadStart();
        HttpParams mParams = new HttpParams();
        mParams.put("userId", userId);
        mParams.put("payType", payType);
        mOkGoHttp.Url(Urls.AllianceBusiness)
                .HttpParams(mParams)
                .Post(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

//                        PubStatusBean mJsonBean = JsonTool.parseObject(mString, PubStatusBean.class);
//                        BindingViewBean mBindingViewBean = new BindingViewBean();
//                        mBindingViewBean.setBean(mJsonBean);
//                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.加盟费支付);
//                        mViewInterface.initBindingView(mBindingViewBean);
//                        mViewInterface.initLoadEnd();
                        MemberUpgradePayBean mJsonBean = JsonTool.parseObject(mString, MemberUpgradePayBean.class);//Gson转Bean
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        if (payType == 1 || payType == 5) {
                            mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.支付宝支付);
                        } else if (payType == 2 || payType == 6) {
                            mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.微信支付);
                        } else {
                            mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.加盟费支付);
                        }

//                        mBindingViewBean.setmEnumStatus(type == 1 ?
//                                BindingViewBean.EnumStatus.支付宝支付 : BindingViewBean.EnumStatus.微信支付);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();
                    }

                    @Override
                    public void onError(String mString) {

                    }
                });

    }


    /**
     * 查找所有车的品牌
     */
    public void DoGetCarBrandAndModel() {
        HttpParams mParams = new HttpParams();
//        mParams.put("parentId", parentId);
        mOkGoHttp.Url(Urls.DoGetCarBrandAndModel)
                .HttpParams(mParams)
                .Get(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        selectAllBrandBean mJsonBean = JsonTool.parseObject(mString, selectAllBrandBean.class);
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.车品牌);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });
    }

    /**
     * @param brandId
     */
    public void DoGetCaristForBrand(String brandId) {
        HttpParams mParams = new HttpParams();
        mParams.put("brandId", brandId);
        mOkGoHttp.Url(Urls.DoGetCaristForBrand)
                .HttpParams(mParams)
                .Get(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        DoGetCaristForBrandBean mJsonBean = JsonTool.parseObject(mString, DoGetCaristForBrandBean.class);
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.车系);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });
    }

    /**
     * @param carId
     * @param type
     */
    public void DoGetFinancialPlanByCarId(String carId, int type) {
        mViewInterface.initLoadStart();
        HttpParams mParams = new HttpParams();
        mParams.put("carId", carId);
        mParams.put("type", type);
        mOkGoHttp.Url(Urls.DoGetFinancialPlanByCarId)
                .HttpParams(mParams)
                .Get(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        DoGetFinancialPlanByCarIdBean mJsonBean = JsonTool.parseObject(mString, DoGetFinancialPlanByCarIdBean.class);
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.金融方案);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });
    }

    /**
     * 总融资额
     *
     * @param carId
     * @param jzqdx 1&0
     */
    public void DoGetDkze(String carId, int jzqdx, String sfbl) {
        mViewInterface.initLoadStart();
        HttpParams mParams = new HttpParams();
        mParams.put("carId", carId);
        mParams.put("jzqdx", jzqdx);
        mParams.put("sfbl", sfbl);
        mOkGoHttp.Url(Urls.DoGetDkze)
                .HttpParams(mParams)
                .Get(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        PubStatusBean mJsonBean = JsonTool.parseObject(mString, PubStatusBean.class);
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.总融资额);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });
    }

    /**
     * 购车订单新增
     *
     * @param bean
     */
    public void InsertOrder(NewOrderBean bean) {
        mViewInterface.initLoadStart();
        HttpParams mParams = new HttpParams();

        mParams.put("intentionId", bean.getIntentionId());
//        mParams.put("userId", bean.getUserid());
        mParams.put("color", bean.getColor());
        mParams.put("jzqdx", bean.getJzqdx());
        mParams.put("userName", bean.getUserName());
        mParams.put("userPhone", bean.getUserPhone());
        mParams.put("idcard", bean.getIdcard());
        mParams.put("carId", bean.getCarId());
        mParams.put("planId", bean.getPlanId());
        mParams.put("dkjd", bean.getDkjd());
        mParams.put("loanType", bean.getCpfn());
        mParams.put("carType", bean.getCarType());
        mParams.put("clientType", bean.getClientType());
        //图片
        mParams.put("sfzzm", bean.getSfzzm());
        mParams.put("sfzfm", bean.getSfzfm());
        mParams.put("yhk", bean.getYhk());
        mParams.put("jsz", bean.getJsz());
        mParams.put("zxsqjt", bean.getZxsqjt());
        mParams.put("zxmqz", bean.getZxmqz());
        mParams.put("sqb", bean.getSqb());
        mParams.put("zxzl", bean.getZxzl());
        mParams.put("qtzl", bean.getQtzl());

        mParams.put("remark", bean.getRemark());

        mParams.put("salesId", bean.getSalesId());
        mParams.put("salesName", bean.getSalesName());
        mParams.put("salesPhone", bean.getSalesPhone());


        mOkGoHttp.Url(Urls.InsertOrder)
                .HttpParams(mParams)
                .Post(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        PubStatusBean mJsonBean = JsonTool.parseObject(mString, PubStatusBean.class);
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.购车订单新增);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });
    }

    /**
     * 购车订单修改
     *
     * @param bean
     */
    public void UpdateIntoContract(NewOrderBean bean) {
        mViewInterface.initLoadStart();
        HttpParams mParams = new HttpParams();

        mParams.put("id", bean.getId());
//        mParams.put("detailId", bean.getDetailId());

//        mParams.put("intentionId", bean.getIntentionId());
//        mParams.put("userId", bean.getIntentionId());
        mParams.put("color", bean.getColor());
        mParams.put("jzqdx", bean.getJzqdx());
        mParams.put("userName", bean.getUserName());
        mParams.put("userPhone", bean.getUserPhone());
        mParams.put("idcard", bean.getIdcard());
        mParams.put("carId", bean.getCarId());
        mParams.put("planId", bean.getPlanId());
        mParams.put("dkjd", bean.getDkjd());
        mParams.put("loanType", bean.getCpfn());
        mParams.put("carType", bean.getCarType());
        mParams.put("clientType", bean.getClientType());
        //图片
        mParams.put("sfzzm", bean.getSfzzm());
        mParams.put("sfzfm", bean.getSfzfm());
        mParams.put("yhk", bean.getYhk());
        mParams.put("jsz", bean.getJsz());
        mParams.put("zxsqjt", bean.getZxsqjt());
        mParams.put("zxmqz", bean.getZxmqz());
        mParams.put("sqb", bean.getSqb());
        mParams.put("zxzl", bean.getZxzl());
        mParams.put("qtzl", bean.getQtzl());

        mParams.put("remark", bean.getRemark());

        mParams.put("salesId", bean.getSalesId());
        mParams.put("salesName", bean.getSalesName());
        mParams.put("salesPhone", bean.getSalesPhone());


        mOkGoHttp.Url(Urls.UpdateIntoContract)
                .HttpParams(mParams)
                .Post(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        PubStatusBean mJsonBean = JsonTool.parseObject(mString, PubStatusBean.class);
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.购车订单新增);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });
    }


    /**
     * 获取购车订单详情
     *
     * @param orderId
     */
    public void DoGetOrderById(String orderId) {
        mViewInterface.initLoadStart();
        HttpParams mParams = new HttpParams();
        mParams.put("orderId", orderId);
        mOkGoHttp.Url(Urls.DoGetOrderById)
                .HttpParams(mParams)
                .Get(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        DoGetOrderByIdBean mJsonBean = JsonTool.parseObject(mString, DoGetOrderByIdBean.class);
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.购车订单详情);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });
    }

    /**
     * 销售人和订单状态查看订单列表
     *
     * @param orderStatus
     * @param salesId
     * @param offset
     */
    public void DoGetOrderListByStatxusAndSalesId(String orderStatus, String salesId, int offset, String serch) {
        mViewInterface.initLoadStart();
        HttpParams mParams = new HttpParams();
        mParams.put("orderStatus", orderStatus);
        mParams.put("salesId", salesId);
        mParams.put("limit", 10);
        mParams.put("serch", serch);
        mParams.put("offset", offset);
        mOkGoHttp.Url(Urls.DoGetOrderListByStatxusAndSalesId)
                .HttpParams(mParams)
                .Get(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        OrderListBean mJsonBean = JsonTool.parseObject(mString, OrderListBean.class);
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.购车订单列表);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });
    }

    /**
     * 购车订单新增
     *
     * @param bean
     */
    public void UpdateContract(UpdateContractBean bean) {
        mViewInterface.initLoadStart();
        HttpParams mParams = new HttpParams();
        mParams.put("id", bean.getId());
        mParams.put("aztime", bean.getAztime());
        //图片
        mParams.put("qualified", bean.getQualified());
        mParams.put("repayment", bean.getRepayment());
        mParams.put("information", bean.getInformation());

        mParams.put("contractRemark", bean.getContractRemark());


        mOkGoHttp.Url(Urls.UpdateContract)
                .HttpParams(mParams)
                .Post(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        PubStatusBean mJsonBean = JsonTool.parseObject(mString, PubStatusBean.class);
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.合同信息修改);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });
    }

    /**
     * 请款信息上传
     *
     * @param bean
     */
    public void UpdateRequestContract(UpdateRequestContractBean bean) {
        mViewInterface.initLoadStart();
        HttpParams mParams = new HttpParams();
        mParams.put("id", bean.getOrderId());
        mParams.put("rchy", bean.getRchy());
        mParams.put("syx", bean.getSyx());
        mParams.put("mqqrh", bean.getMqqrh());
        mParams.put("mqqrhhy", bean.getMqqrhhy());
        mParams.put("invoice", bean.getInvoice());
        mParams.put("jqx", bean.getJqx());
        mParams.put("swbzq", bean.getSwbzq());
        mParams.put("qtzlzp", bean.getQtzlzp());
        mOkGoHttp.Url(Urls.UpdateRequestContract)
                .HttpParams(mParams)
                .Post(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        PubStatusBean mJsonBean = JsonTool.parseObject(mString, PubStatusBean.class);
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.请款信息上传);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });
    }

    /**
     * 订单完成
     *
     * @param id
     */
    public void UpdateByIdCompleted(String id, String userid) {
        mViewInterface.initLoadStart();
        HttpParams mParams = new HttpParams();
        mParams.put("orderId", id);
        mParams.put("userId", userid);
        mOkGoHttp.Url(Urls.UpdateByIdCompleted)
                .HttpParams(mParams)
                .Post(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        PubStatusBean mJsonBean = JsonTool.parseObject(mString, PubStatusBean.class);
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.订单完成);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });
    }

    /**
     * 查询所有分类管理
     *
     * @param shopServiceId
     * @param parentId
     */
    public void ApiShopServiceType(String shopServiceId, String parentId) {
        mViewInterface.initLoadStart();
        HttpParams mParams = new HttpParams();
        mParams.put("shopServiceId", shopServiceId);
        mParams.put("parentId", parentId);
        mOkGoHttp.Url(Urls.ApiShopServiceType)
                .HttpParams(mParams)
                .Post(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        ApiShopServiceTypeBean mJsonBean = JsonTool.parseObject(mString, ApiShopServiceTypeBean.class);
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.查询所有分类);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });
    }

    /**
     * 私有车行
     *
     * @param userid
     */
    public void QueryCarDealerDetailsPrivate(String userid) {
        mViewInterface.initLoadStart();
        HttpParams mParams = new HttpParams();
        mParams.put("id", userid);
        mOkGoHttp.Url(Urls.QueryCarDealerDetailsPrivate)
                .HttpParams(mParams)
                .Post(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        QueryCarDealerDetailsPrivateBean mJsonBean = JsonTool.parseObject(mString, QueryCarDealerDetailsPrivateBean.class);
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.私有车行);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });
    }

    /**
     * 公有车行详情
     *
     * @param userid
     */
    public void QueryCarDealerDetailsPublic(String userid, double longitude, double latitude) {
        mViewInterface.initLoadStart();
        HttpParams mParams = new HttpParams();
        mParams.put("id", userid);
        mParams.put("longitude", longitude);
        mParams.put("latitude", latitude);
        mOkGoHttp.Url(Urls.QueryCarDealerDetailsPublic)
                .HttpParams(mParams)
                .Post(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        QueryCarDealerDetailsPrivateBean mJsonBean = JsonTool.parseObject(mString, QueryCarDealerDetailsPrivateBean.class);
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.公有车行);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });
    }

    /**
     * 新增一级分类
     *
     * @param shopServiceId
     * @param typeName
     */
    public void AddOneLevel(String shopServiceId, String typeName) {
        mViewInterface.initLoadStart();
        HttpParams mParams = new HttpParams();
        mParams.put("shopServiceId", shopServiceId);
        mParams.put("typeName", typeName);
        mOkGoHttp.Url(Urls.AddOneLevel)
                .HttpParams(mParams)
                .Post(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        PubStatusBean mJsonBean = JsonTool.parseObject(mString, PubStatusBean.class);
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.新增一级分类);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });
    }

    /**
     * 新增二级分类
     *
     * @param shopServiceId
     * @param parentId
     * @param typeName
     * @param typeBrief
     */
    public void AddTwoLevel(String shopServiceId, String parentId, String typeName, String typeBrief) {
        mViewInterface.initLoadStart();
        HttpParams mParams = new HttpParams();
        mParams.put("shopServiceId", shopServiceId);
        mParams.put("typeName", typeName);
        mParams.put("parentId", parentId);
        mParams.put("typeBrief", typeBrief);
        mOkGoHttp.Url(Urls.AddTwoLevel)
                .HttpParams(mParams)
                .Post(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        PubStatusBean mJsonBean = JsonTool.parseObject(mString, PubStatusBean.class);
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.新增二级分类);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });
    }

    /**
     * 编辑分类管理
     *
     * @param shopServiceId
     * @param typeName
     */
    public void EditLevel(String shopServiceId, String typeName, String typeBrief) {
        mViewInterface.initLoadStart();
        HttpParams mParams = new HttpParams();
        mParams.put("id", shopServiceId);
        mParams.put("typeName", typeName);
        mParams.put("typeBrief", typeBrief);
        mOkGoHttp.Url(Urls.EditLevel)
                .HttpParams(mParams)
                .Post(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        PubStatusBean mJsonBean = JsonTool.parseObject(mString, PubStatusBean.class);
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.编辑分类管理);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });
    }

    /**
     * 删除分类
     *
     * @param shopServiceId
     * @param id
     */
    public void DelLevel(String shopServiceId, String id) {
        mViewInterface.initLoadStart();
        HttpParams mParams = new HttpParams();
        mParams.put("shopServiceId", shopServiceId);
        mParams.put("id", id);
        mOkGoHttp.Url(Urls.DelLevel)
                .HttpParams(mParams)
                .Post(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        PubStatusBean mJsonBean = JsonTool.parseObject(mString, PubStatusBean.class);
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.删除分类管理);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });
    }

    /**
     * 热词配置查询
     *
     * @param shopId
     */
    public void QueryHotWord(String shopId) {
        mViewInterface.initLoadStart();
        HttpParams mParams = new HttpParams();
        mParams.put("shopId", shopId);
        mOkGoHttp.Url(Urls.QueryHotWord)
                .HttpParams(mParams)
                .Post(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        QueryHotWordBean mJsonBean = JsonTool.parseObject(mString, QueryHotWordBean.class);
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.热词配置查询);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });
    }

    /**
     * 删除热词
     *
     * @param id
     */
    public void DelHotWord(String id) {
        mViewInterface.initLoadStart();
        HttpParams mParams = new HttpParams();
        mParams.put("id", id);
        mOkGoHttp.Url(Urls.DelHotWord)
                .HttpParams(mParams)
                .Post(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        PubStatusBean mJsonBean = JsonTool.parseObject(mString, PubStatusBean.class);
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.删除热词);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });
    }

    /**
     * 服务门店热词新增
     *
     * @param shopId
     * @param hotWord
     */
    public void AddHotWord(String shopId, String hotWord) {
        mViewInterface.initLoadStart();
        HttpParams mParams = new HttpParams();
        mParams.put("shopId", shopId);
        mParams.put("hotWord", hotWord);
        mOkGoHttp.Url(Urls.AddHotWord)
                .HttpParams(mParams)
                .Post(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        PubStatusBean mJsonBean = JsonTool.parseObject(mString, PubStatusBean.class);
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.新增热词);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });
    }

    /**
     * 获取每个分类下的商品
     *
     * @param levelOne
     * @param shopId
     */
    public void ShopGoodsList(String levelOne, String shopId) {
        mViewInterface.initLoadStart();

        HttpParams mParams = new HttpParams();
        mParams.put("shopId", shopId);
        mParams.put("levelOne", levelOne);

        mParams.put("serviceState", 1);

        mOkGoHttp.Url(Urls.selectLevel2AndService)
                .HttpParams(mParams)
                .Post(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        ShopGoodsListBean mJsonBean = JsonTool.parseObject(mString, ShopGoodsListBean.class);
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.店铺商品);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });
    }

    /**
     * 根据车型查找车辆颜色
     *
     * @param carId
     */
    public void SelectCarByColor(String carId) {
        mViewInterface.initLoadStart();

        HttpParams mParams = new HttpParams();
        mParams.put("carId", carId);
        mOkGoHttp.Url(Urls.SelectCarByColor)
                .HttpParams(mParams)
                .Get(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        SelectCarByColorBean mJsonBean = JsonTool.parseObject(mString, SelectCarByColorBean.class);
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.根据车型查颜色);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });
    }

    /**
     * 服务订单查询
     *
     * @param shopId
     * @param orderId
     */
    public void BShopServiceOrderList(String shopId, String orderId, int type, int offset) {
        mViewInterface.initLoadStart();

        HttpParams mParams = new HttpParams();
        mParams.put("shopId", shopId);
        mParams.put("orderId", orderId);
        mParams.put("limit", 10);
        mParams.put("offset", offset);
        mParams.put("state", type);

        mOkGoHttp.Url(Urls.BShopServiceOrderList)
                .HttpParams(mParams)
                .Post(new OkGoHttpListener() {
                    @Override
                    public void onSuccess(String mString) {

                        ShopServiceOrder mJsonBean = JsonTool.parseObject(mString, ShopServiceOrder.class);
                        BindingViewBean mBindingViewBean = new BindingViewBean();
                        mBindingViewBean.setBean(mJsonBean);
                        mBindingViewBean.setmEnumStatus(BindingViewBean.EnumStatus.服务订单查询);
                        mViewInterface.initBindingView(mBindingViewBean);
                        mViewInterface.initLoadEnd();

                    }

                    @Override
                    public void onError(String mString) {

                    }
                });
    }

}
